class LocalCache {
  setItem(key: string, value: any) {
    if (value) {
      value = JSON.stringify(value)
      localStorage.setItem(key, value)
    }
  }
  getItem(key: string) {
    let value = localStorage.getItem(key)
    if (value) value = JSON.parse(value)
    return value
  }
  delete(key: string) {
    localStorage.removeItem(key)
  }
  clear() {
    localStorage.clear()
  }
}
export default new LocalCache()
export enum CacheKey {
  TOKEN = 'Token',
  USER_INFO = 'userInfo',
  ROLE_MENU = 'roleMenu'
}
